package com.kyub.buganville

import grails.plugins.springsecurity.Secured

class DashboardController {

  def springSecurityService

  @Secured(['ROLE_ADMIN', 'ROLE_DEVELOPER'])
  def index = {
   def principal = springSecurityService.principal
      String username = principal.username
      def boundUser = User.findByUsername(username)
      def unassigned = Issue.findByAsegneeIsNull()
      
      [issues : Issue.findByAsegneeAndStatus(boundUser, IssueStatus.OPEN) ,unassigned:unassigned ]
  }
}
